#!/bin/bash 
set -e

TMP=${TMP:-/tmp/work}
LOG=${LOG:-$HOME/logs/stage3}
SRC=${SRC:-/sources}

name=perl-xml-parser
version=2.46

rm -rf $TMP
mkdir -p $TMP $LOG

tar xf $SRC/XML-Parser-$version.tar.gz -C $TMP

{ time \
   {

    cd $TMP/XML-Parser-$version
    
    perl Makefile.PL

    make

    make install

    }
} 2>&1 | tee $name.log
    
[ $PIPESTATUS = 0 ] && mv $name.log $LOG || exit $PIPESTATUS

rm -fr $TMP
